<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>cblog</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css" rel="stylesheet">
<link rel="stylesheet" href="${pageContext.request.contextPath}/widget/bootstrap/css/bootstrap.min.css">
<script src="${pageContext.request.contextPath}/widget/jquery/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/widget/bootstrap/js/bootstrap.min.js"></script>
<style type="text/css">
	body {
		padding-top: 60px;
		padding-bottom: 40px;
	}
</style>
</head>
<body>
	<!-- header 导航，搜索 -->
	<jsp:include page="template/common/header.jsp"></jsp:include>
	
	<!-- body -->
	<div class="container-fluid">
		<div class="row">
			<!--留空-->
			<div class="col-md-1"></div>
			<div class="col-md-10">
				<!--main-->
				<div class="col-md-8">
					<jsp:include page="${mainPage}"></jsp:include>
				</div>
				<!--side-->
				<div class="col-md-4 side-list">
					<article class="recent-posts">
						<h4>最近文章</h4>
						<ul>
							<c:forEach var="recentArticle" items="${recentArticles}">
								<li><a class="item"
									href="${pageContext.request.contextPath}/article?articleId=${recentArticle.id}">${recentArticle.title}</a>
								</li>
							</c:forEach>
						</ul>
					</article>
					<article class="recent-comments">
						<h4>最近回复</h4>
						<ul>
							<c:forEach var="recentMsg" items="${recentMsgs}">
								<li><a href="${recentMsg.user.website}">${recentMsg.user.nickname}</a>:<a
									href="${pageContext.request.contextPath}/msg?action=leaveMsg">${recentMsg.content}</a>
								</li>
							</c:forEach>
						</ul>
					</article>

					<article class="friends">
						<h4>友情链接</h4>
						<ul>
							<c:forEach var="friend" items="${friends}">
								<li><a href="${friend.url}" target="_blank">${friend.title}</a></li>
							</c:forEach>
						</ul>
					</article>
				</div>
			</div>

			<!--留空-->
			<div class="col-md-1"></div>
		</div>
		<jsp:include page="/template/common/footer.jsp"></jsp:include>
	</div>
</body>
</html>